Include full GPX schema header. Derived from patch from Jochen.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 20 Sep 2002 17:08:13 +0000 (17:08 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 20 Sep 2002 17:08:13 +0000 (17:08 +0000)
gpsbabel/gpx.c
gpsbabel/magproto.c

index 0f03c110deab66e8b3166d65b717d836bbc38553..152ff2194047ff51c5666250514c4266ad343c9c 100644 (file)
@@ -234,10 +234,17 @@ gpx_waypt_pr(const waypoint *waypointp)
 void
 gpx_write(void)
 {
-       fprintf(ofd, "<?xml version=\"1.0\"?>\n");
-       fprintf(ofd, "<gpx\n\tversion=\"1.0\">\n");
        setshort_length(32);
+
+       fprintf(ofd, "<?xml version=\"1.0\"?>\n");
+       fprintf(ofd, "<gpx\n version=\"1.0\"\n");
+       fprintf(ofd, "creator=\"GPSBabel - http://gpsbabel.sourceforge.net\"\n");
+       fprintf(ofd, "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n");
+       fprintf(ofd, "xmlns=\"http://www.topografix.com/GPX/1/0\"\n");
+       fprintf(ofd, "xsi:schemaLocation=\"http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd\">\n");
+
        waypt_disp_all(gpx_waypt_pr);
+
        fprintf(ofd, "</gpx>\n");
 }
 
index c30b0174dab173407541b15611e2a47c86e62e5d..5ba1ff305e9d824658a30fd1c7f9d3cee8d75cd7 100644 (file)
@@ -500,7 +500,7 @@ mag_rd_init(const char *portname)
        
        mag_handon();
        now = time(NULL);
-       later = now + 2;
+       later = now + 3;
        if (!is_file) {
                mag_writemsg("PMGNCMD,VERSION");
        }
@@ -770,7 +770,11 @@ mag_write(void)
                mag_readmsg();
                mag_readmsg();
        }
-
+       /* 
+        * Whitespace is actually legal, but since waypoint name length is
+        * only 8 bytes, we'll conserve them.
+        */
+       setshort_whitespace_ok(0);
        waypt_disp_all(mag_waypt_pr);
 }